<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>个人信息</caption>
  <tr><td>照片：</td><td id="head_td"></td></tr>
  <tr><td>姓名：</td><td id="name_td"></td></tr>
  <tr><td>年龄：</td><td id="age_td"></td></tr>
  <tr><td>好友们：</td><td id="friend_td"></td></tr>
</table>
<input type="button" value="加载数据" onclick="f()" >
<script>
    let headtd=document.querySelector("#head_td");
    let nametd=document.querySelector("#name_td");
    let agetd=document.querySelector("#age_td");
    let friendtd=document.querySelector("#friend_td");
  function f(){
    let p={name:"老刘",age:"20",imgUrl:"liu.jpg",friends:["貂蝉","小乔","王美人"]}
      nametd.innerText=p.name;
      agetd.innerText=p.age;
      let img=document.createElement("img");
      img.src=p.imgUrl;
      img.width=100;
      headtd.append(img);
      let ul=document.createElement("ul");
      for (let friend of p.friends){
          let li=document.createElement("li");
          li.innerText=friend;
          ul.append(li);

      }
      friendtd.append(ul);
  }

</script>
</body>
</html>